package com.example.demo.web.mqtt;

import java.io.IOException;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.ObjectMapper;

public class MqttHeaderDeserializer extends JsonDeserializer<MqttHeader> {
	  private static final ObjectMapper mapper = new ObjectMapper();

	  @Override
	  public MqttHeader deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
	    return mapper.readValue(jsonParser.getText(), MqttHeader.class);
	  }
}
